package com.tencent.smtt.sdk;

import android.content.Context;
import android.os.Handler;
import com.tencent.smtt.utils.TbsLog;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public final class k extends Thread {
    final /* synthetic */ Context a;
    final /* synthetic */ Handler b;

    /* JADX INFO: Access modifiers changed from: package-private */
    public k(Context context, Handler handler) {
        this.a = context;
        this.b = handler;
    }

    @Override // java.lang.Thread, java.lang.Runnable
    public void run() {
        boolean z;
        int a = am.a().a(true, this.a);
        TbsDownloader.setAppContext(this.a);
        TbsLog.i("QbSdk", "QbSdk preinit ver is " + a);
        if (a == 0) {
            am.a().c(this.a, true);
        }
        if (TbsConfig.APP_WX.equals(QbSdk.getCurrentProcessName(this.a))) {
            z = QbSdk.A;
            if (!z && !WebView.mWebViewCreated) {
                TbsLog.i("QbSdk", "preInit -- prepare initAndNotLoadSo");
                am.a().b(this.a, true);
                o.a(true).a(this.a, false, false);
                bt a2 = bt.a();
                int j = am.a().j(this.a);
                TbsLog.i("QbSdk", "QbSdk preinit coreversion is " + j);
                if (j > 0) {
                    a2.b(this.a);
                    return;
                }
                return;
            }
        }
        TbsLog.i("QbSdk", "preInit -- prepare initAndLoadSo");
        o.a(true).b(this.a, false, false);
        bt a3 = bt.a();
        a3.a(this.a);
        boolean b = a3.b();
        this.b.sendEmptyMessage(3);
        if (b) {
            this.b.sendEmptyMessage(1);
        } else {
            this.b.sendEmptyMessage(2);
        }
    }
}
